package com.xiaohudie.entity;

import java.util.Comparator;

public class ProgramerCompare  implements Comparator<Programer> {

        public int compare(Programer o1, Programer o2) {
            //    return o1.id -o2.id;
            /**关键逻辑在这里*/
            int idNum = o1.getId()-o2.getId();
            int nameNum = idNum==0 ? o1.getName().length()-o2.getName().length() : idNum;
            return nameNum;
        }
    }
